#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import MySQLdb
import sys

host=sys.argv[1]
port=sys.argv[2]
user=sys.argv[3]
password=sys.argv[4]
db=sys.argv[5]

conn=MySQLdb.connect(host,user,password,db)
cursor=conn.cursor()
cursor.execute("SET NAMES utf8")
sql="select id,cid,sid from nas_event where eventName='客户询盘'"
cursor.execute(sql)
result=cursor.fetchall()
for line in result:
    print "\001".join(map(str,line))